home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / MISC / MAG08.ZIP / SCRLLX02.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-04-30  |  1.3 KB  |  63 lines

  1. Program Prllx02;
  2.  
  3. Uses Mode13h,Crt;
  4.  
  5. Var Xcloud1,Width1:Integer;
  6.     Xcloud2,Width2:Integer;
  7.  
  8. Procedure ScrollUpClouds;
  9. Begin
  10.      Move(Mem[Vp[1]:320],Mem[Vp[1]:0],63680);
  11.  
  12.      Line(0,199,319,199,0,Vp[1]);
  13.  
  14.      { Cloud number one }
  15.      Line(Xcloud1,199,Xcloud1+Width1,199,3,Vp[1]);
  16.      Xcloud1:=Xcloud1+Random(5)-2;
  17.      If Xcloud1<0 Then Xcloud1:=0;
  18.      If Xcloud1>319 Then Xcloud1:=319;
  19.      Width1:=Width1+Random(5)-2;
  20.      If Width1+Xcloud1>319 Then Width1:=319-Xcloud1;
  21.      { Cloud number two }
  22.      Line(Xcloud2,199,Xcloud2+Width2,199,3,Vp[1]);
  23.      Xcloud2:=Xcloud2+Random(5)-2;
  24.      If Xcloud2<0 Then Xcloud2:=0;
  25.      If Xcloud2>319 Then Xcloud2:=319;
  26.      Width2:=Width2+Random(5)-2;
  27.      If Width2+Xcloud2>319 Then Width2:=319-Xcloud2;
  28. End;
  29.  
  30. Procedure GlobalInit;
  31. Begin
  32.      Randomize;
  33.      Initgraph;
  34.      InitVirt;
  35. End;
  36.  
  37. Procedure GlobalClose;
  38. Begin
  39.      Closegraph;
  40.      Closevirt;
  41. End;
  42.  
  43. Procedure CloudInit;
  44. Begin
  45.      SetColor(0,0,0,0);
  46.      SetColor(3,55,55,55);
  47.      Width1:=50; Width2:=50;
  48.      Xcloud1:=50; Xcloud2:=250;
  49.      Cls(0,Vp[1]);
  50. End;
  51.  
  52. Begin
  53.      GlobalInit;
  54.      CloudInit;
  55.  
  56.      Repeat
  57.            ScrollUpClouds;
  58.            CopyPage(Vp[1],Vga);
  59.      Until Keypressed;
  60.  
  61.      GlobalClose;
  62. End.
  63.